#include <cstdio>
#include <iostream>
 
using namespace std;
 
int getStandard(int arr[] ,int low ,int high);
void quickSort(int arr[] ,int low ,int high);
void display(int arr[],int s, int e);
int main() {
 
	int arr[] = {25,14,655,664,646,44,4874,4545,4545454545,999999,458878};
	int len = sizeof(arr) / sizeof(int);
	display(arr,0,len);
	quickSort(arr,0,len-1);
	display(arr,0,len);
	getchar();
	return 0;
}
 
int getStandard(int arr[] ,int low , int high) {
 
	int key = arr[low];
 
	while (low < high) {
		while (low < high && arr[high] >= key) {
			high--;
		}
		if (low < high) {
			arr[low] = arr[high];
		} 
		while (low < high && arr[low] <= key) {
			low++;
		}
		if (low < high) {
			arr[high] = arr[low];
		}
	}
	arr[low] = key;
	return low;
}
void quickSort(int arr[] ,int low ,int high) {
	if (low < high) {
		int standard = getStandard(arr,low,high);
 
		quickSort(arr,low,standard-1);
 
		quickSort(arr,standard+1,high);
	}
}
void display(int arr[],int s, int e) {
	for(s;s<e;s++) {
		printf("%10d",arr[s]);
	}
	printf("\n");
}